//
//  LJP_RecommendCell.m
//  God_is_a_Girl
//
//  Created by 李继鹏 on 15/9/28.
//  Copyright (c) 2015年 呸. All rights reserved.
//

#import "LJP_RecommendCell.h"
#import "LJP_RecommendView.h"
#import "LJP_RecommendModel.h"
#import <UIImageView+WebCache.h>
@implementation LJP_RecommendCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        self.recommend = [[LJP_RecommendView alloc]init];
        [self.contentView addSubview:self.recommend];
        
        
    }
    return self;
}
- (void)layoutSubviews

{
    [super layoutSubviews];
    self.recommend.frame = CGRectMake(5, 5, self.contentView.frame.size.width-5, self.contentView.frame.size.height-5);
    self.recommend.layer.cornerRadius = 5;//圆角
    self.recommend.layer.masksToBounds = YES;
    
}
- (void)setModel:(LJP_RecommendModel *)model
{
    if (model != _model) {
        _model = model;
    }
    [self.recommend.backview sd_setImageWithURL:[NSURL URLWithString:model.backview] placeholderImage:[UIImage imageNamed:@"jiazai.png"]];
    
    self.recommend.index_title.text = model.index_title;
    
    self.recommend.popular_place_str.text =[NSString stringWithFormat:@"🏠%@",model.popular_place_str];
    
    self.recommend.name.text = model.name;
    
    self.recommend.view_count.text = [NSString stringWithFormat:@"%@ 次浏览", model.view_count];
    
    self.recommend.day_count.text = [NSString stringWithFormat:@"%@天时间",model.day_count];
    
    self.recommend.first_day.text =[NSString stringWithFormat:@"🕑%@",model.first_day];
    
    [self.recommend.headview sd_setImageWithURL:[NSURL URLWithString:model.headview] placeholderImage:[UIImage imageNamed:@"tuji"]];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
